
package org.finegold.core.elasticsearch.config;

import lombok.AllArgsConstructor;

import org.finegold.core.datascope.handler.ScopeModelHandler;
import org.finegold.core.elasticsearch.aspect.FineEsAspect;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Elasticsearch配置类
 *
 * @author QinXueFeng
 */
@Configuration
@AllArgsConstructor
public class ElasticsearchConfiguration {

	private final ScopeModelHandler scopeModelHandler;
	@Bean
	@ConditionalOnBean(ScopeModelHandler.class)
	public FineEsAspect fineEsAspect() {
		return new FineEsAspect(scopeModelHandler);
	}
}
